package com.infitecs.eyas.autocomplete.service;

import com.infitecs.eyas.autocomplete.dao.AutoCompleteDao;

import com.infitecs.krill.autocomplete.model.AutoComplete;
import com.infitecs.krill.autocomplete.service.AbstractAutoCompleteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * AutoCompleteServiceImpl
 *
 * @author gaoxinyu
 */
@Service("autoCompleteService")
public class CustomAutoCompleteServiceImpl extends AbstractAutoCompleteService {

    @Autowired
    private AutoCompleteDao autoCompleteDao;

    @Override
    protected void initAutoCompleteMap() {
        Map<String, List<AutoComplete>> autoCompleteMap = new HashMap<>();
        autoCompleteMap.put("gAutoNickname", autoCompleteDao.gAutoNickName());
        autoCompleteMap.put("gAutoUsername", autoCompleteDao.gAutoUsername());
        autoCompleteMap.put("gAutoMenu", autoCompleteDao.gAutoMenu());
        autoCompleteMap.put("gAutoRoleName", autoCompleteDao.gAutoRoleName());
        autoCompleteMap.put("gAutoCityName", autoCompleteDao.gAutoCityName());
        autoCompleteMap.put("gAutoFormulaType", autoCompleteDao.gAutoFormulaType());
        autoCompleteMap.put("mps",autoCompleteDao.getAllMps());
        autoCompleteMap.put("mp",autoCompleteDao.getAllMp());
        autoCompleteMap.put("zgm",autoCompleteDao.getAllZgm());
        autoCompleteMap.put("zgmI",autoCompleteDao.getAllZgmI());
        autoCompleteMap.put("zgmII",autoCompleteDao.getAllZgmII());
        autoCompleteMap.put("zgmIII",autoCompleteDao.getAllZgmIII());
        autoCompleteMap.put("mpsHpII",autoCompleteDao.getAllMpsHpII());
        autoCompleteMap.put("e",autoCompleteDao.getAllE());
        autoCompleteMap.put("hp",autoCompleteDao.getAllHp());
        setAutoCompleteMap(autoCompleteMap);
    }
}
